
ARG ALPINE_VERSION=3.12.0

FROM alpine:$ALPINE_VERSION

LABEL maintainer="binave <nidnil@icloud.com>"

ARG ALPINE_VERSION
ARG REPO_MIRRORS_URL=https://mirrors.huaweicloud.com/alpine

RUN printf "${REPO_MIRRORS_URL}/%s\n" \
    v${ALPINE_VERSION%.*}/main \
    v${ALPINE_VERSION%.*}/community \
    edge/testing \
    > /etc/apk/repositories && \
    apk update --no-cache; \
:                \
:   install apk  \
;                \
    apk add --no-cache openvpn easy-rsa bash && \
    cp -v /usr/share/easy-rsa/openssl-easyrsa.cnf /etc/openvpn; \
    printf "%s\n" \
H4sICK8ZEV8AA292cG5kLnNoAMxce3fTSJb/e/0pahw3tpvILwIDDmYmHdLdmYaQTYDu3iSTI0tl \
WyeyJPRIyJDsZ9/fvVWlhx+Q0HSfNQcSS7du3fdLJTb+1h17QXdsJ7NabUOEkQwuo0C4tpyHAV1x \
wuBSxqnY3X95JA5jOfE+ipbsTDui36E/ve5gqy3SUBxn40Cm4rWdXFQBxODx447522sDZyKlmKVp \
lAy7XTd0OvNe0Os4s+6HzHMuktSO08jpekEahxZt25mlc792Tr+eR0zBIOHNzufYrNUWn2oCnxNR \
b/Tr4kzc3IhYplkciP4230lAV+NTv3va7Yrb7Rpf80PH9gXwEA7hjXoidFKZJqNGq9UYiK542m6L \
UwZlFNn4nAHo/uDxE2GJgfj+e9F6it9owXdYIPCnrfFPwli0WtvCE8/FFv14OBL9dpvvuWGO15uA \
7oYnLB8kKgrE2bZIZzLIYfT+ROjDUZ3EWNeb0Ef6BsdodFcUjZydKqZErlvRqxdwE09zESjwKIau \
JiR9SFmvGfZvseK2bEF3NRAyps9aW+28pP5BySwqpjBYMgWllyxwUi8MxLn8GIGDIM1XFWYBd5Aj \
sBOFVzIeDYQBHfW2c8irmedLEnyrReCiC+kzPOzGmqaiR0ooaZo+rZbBpM2hQJdLsyTRhoHWtN+W \
TZftVvE96uUmp6w5gCIG3e5ph+y9TESrpZfQ/mS6jVYuB5FbdoO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g2gexkLE6SSnpUO4CrmIG4jVmP74zBk8sL9kwi \
Ap56Drh79inQA/6/pLYtdWLFwGnuJOVZLA60N/KjO4mIzl8cXLyjVVYAAA== \
| base64 -d | gzip -d > /usr/local/bin/ovpnd && \
    chmod +x /usr/local/bin/ovpnd

EXPOSE 1194/udp

STOPSIGNAL SIGTERM

CMD ["ovpnd", "start"]
